package com.xf.spring.factory;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by xiefei on 2015/12/28.
 */
public class InstanceCarFactory {
    private Map<String ,Car> cars=null;
    public InstanceCarFactory(){
        cars=new HashMap<String, Car>();
        cars.put("Aodi",new Car("Aodi",300));
        cars.put("Fute",new Car("Fute",400));
    }
    public Car getCar(String name){
        return cars.get(name);
    }

}
